"""\
wrts.nl API in python
http://www.wrts.nl/colofon/api

R.R. Nederhoed (rr@nederhoed.com)
2007-06-24

All pywrts code is released as Open Source under the GPL license:
http://www.gnu.org/licenses/gpl.html

In short:you can copy, modify and use this code, as long as you release 
your work under GPL. Please contact me when you want to use this code 
commercially. We'll work it out.

Use at your own risk! I do not accept any responsability.

Please notify me if you have requests or found bugs.


Dependencies:

- ElementTree
  Shipped with Python 2.5, download for earlier versions:
  http://effbot.org/zone/elementtree.htm


DocTests:
>>> api = WrtsApi(WRTS_USERNAME, WRTS_PASSWORD)
>>> isinstance(api.get_list_ids(), list)
True

$Id: $
"""
__version__ = "$Revision: $"

from connection import WrtsApi

# globals
# Change to match your wrts.nl account
WRTS_USERNAME = 'rr@nederhoed.com'

def get_password():
    import getpass
    return getpass.getpass("wrts.nl password please:")

def main():
    """Program code, development only """
    # Instantiation
    api = WrtsApi(WRTS_USERNAME, get_password())
    
    # Demonstration of functionality
    for list_id in api.get_list_ids():
        print api.get_list(list_id)
        for item in api.get_list_results(list_id):
            print item


def _test(verbose=False):
    """Run tests on module """
    global WRTS_PASSWORD
    WRTS_PASSWORD = get_password()
    import doctest
    doctest.testmod(verbose=verbose)


if __name__ == "__main__":
    main()
    #_test(True)
